<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/templates/template_admin.xhtml">
        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
                <h:form>
                        <h1><h:outputText value="Create Vacancy"/></h1>
                        <h:panelGrid columns="2">
                               
                            <h:outputLabel value="Title:" for="title" />
                            <h:inputText id="title" value="#{hrmb.vac.title}" required="true" requiredMessage="The Title field is required."/>                            
                            <h:outputLabel value="Status:" for="status" />
                            <h:selectOneMenu id="status"
                                             value="#{hrmb.vac.status}"
                                                 styleClass="text-input medium-input">
                                    <f:selectItem itemLabel="0" itemValue="0"/>
                                    <f:selectItem itemLabel="1" itemValue="1" />
                                    
                                </h:selectOneMenu>
                            <h:outputLabel value="NumberRequirement:" for="numberRequirement" />
                            <h:inputText id="numberRequirement" value="#{hrmb.vac.numberRequirement}" required="true" requiredMessage="The Title field is required."/>
                            <h:outputLabel value="Position:" for="position" />
                            <h:inputText id="position" value="#{hrmb.vac.position}" required="true" requiredMessage="The position field is required."/>
                            <h:outputLabel value="WorkingPlace:" for="workingPlace" />
                            <h:inputText id="workingPlace" value="#{hrmb.vac.workingPlace}" required="true" requiredMessage="The workingPlace field is required."/>
                            <h:outputLabel value="WorkType:" for="workType" />
                            <h:inputText id="workType" value="#{hrmb.vac.workType}" required="true" requiredMessage="The workType field is required."/>
                            <h:outputLabel value="MinimumSalary:" for="minimumSalary" />
                            <h:selectOneMenu id="minimumSalary"
                                             value="#{hrmb.vac.minimumSalary}"
                                                 styleClass="text-input medium-input">
                                    <f:selectItem itemLabel="1800000" itemValue="1800000"/>
                                    <f:selectItem itemLabel="2200000" itemValue="2200000" />
                                    <f:selectItem itemLabel="3000000" itemValue="3000000" />
                                    
                                </h:selectOneMenu>
                    <h:outputLabel value="MaximumAge" for="maximumAge" />
                    <h:selectOneMenu id="maximumSalary"
                                     value="#{hrmb.vac.maximumSalary}"
                                                 styleClass="text-input medium-input">
                                    <f:selectItem itemLabel="4000000" itemValue="4000000"/>
                                    <f:selectItem itemLabel="5000000" itemValue="5000000"/>
                                    <f:selectItem itemLabel="6000000" itemValue="6000000" />
                                    
                                </h:selectOneMenu>
                            <h:outputLabel value="Description:" for="description" />
                            <h:inputTextarea id="description" value="#{hrmb.vac.description}" style="width: 500px; height: 100px" required="true" requiredMessage="The description field is required."/>
                    <h:outputLabel value="SkillRequirement" for="skillRequirement" />
                     <h:inputTextarea id="skillRequirement" value="#{hrmb.vac.skillRequirement}" style="width: 500px; height: 100px" required="true" requiredMessage="The skillRequirement field is required."/>
                    <h:outputLabel value="Entitlement" for="entitlement" />
                    <h:inputTextarea id="entitlement" value="#{hrmb.vac.entitlement}" style="width: 500px; height: 100px" required="true" requiredMessage="The entitlement field is required."/>
                            
                            <h:outputLabel value="MinimumAge" for="minimumAge" />
                    <h:selectOneMenu id="minimumAge"
                                     value="#{hrmb.vac.minimumAge}"
                                                 styleClass="text-input medium-input">
                                    <f:selectItem itemLabel="18" itemValue="18"/>
                                    <f:selectItem itemLabel="20" itemValue="20" />
                                    <f:selectItem itemLabel="22" itemValue="22" />
                                    <f:selectItem itemLabel="24" itemValue="24" />
                                </h:selectOneMenu>
                    <h:outputLabel value="MaximumAge" for="maximumAge" />
                    <h:selectOneMenu id="maximumAge"
                                     value="#{hrmb.vac.maximumAge}"
                                                 styleClass="text-input medium-input">
                                    <f:selectItem itemLabel="30" itemValue="30"/>
                                    <f:selectItem itemLabel="35" itemValue="35" />
                                    <f:selectItem itemLabel="38" itemValue="38" />
                                    <f:selectItem itemLabel="40" itemValue="40" />
                                </h:selectOneMenu>
                            <h:outputLabel value="Gender:" for="gender" />
                            <h:selectOneMenu id="gender"
                                     value="#{hrmb.vac.gender}"
                                                 styleClass="text-input medium-input">
                                    <f:selectItem itemLabel="Male" itemValue="#{true}"/>
                                    <f:selectItem itemLabel="Female" itemValue="#{false}" />
                                </h:selectOneMenu>
                            <h:outputLabel value="Degree:" for="degree" />
                            <h:inputText id="degree" value="#{hrmb.vac.degree}" required="true" requiredMessage="The Title degree is required."/>
                            <h:outputLabel value="YearOfExperience:" for="yearOfExperience" />
                            <h:inputText id="yearOfExperience" value="#{hrmb.vac.yearOfExperience}" required="true" requiredMessage="The yearOfExperience field is required."/>
                            <h:outputLabel value="ProbationaryPeriod:" for="probationaryPeriod" />
                            <h:inputText id="probationaryPeriod" value="#{hrmb.vac.probationaryPeriod}" required="true" requiredMessage="The probationaryPeriod field is required."/>
                            <h:outputLabel value="Deadline:" for="deadline" />
                            <h:inputText id="deadline" value="#{hrmb.vac.deadline}" required="true" requiredMessage="The deadline field is required.">
                                <f:convertDateTime pattern="yyyy-MM-dd" />
                            </h:inputText>
                            <h:outputLabel value="DepartmentID:" for="departmentID" />
                            <h:selectOneMenu id="employeeID" value="#{hrmb.departmentID}">
                        <f:selectItems var="d" value="#{dmb.depList()}" itemLabel="#{d.name}" itemValue="#{d.departmentID}"></f:selectItems>                        
                    </h:selectOneMenu>
                        </h:panelGrid>     
                <br />
                <h:commandButton action="#{hrmb.createvaca()}" value="Save" />
                <br />
                <h:commandButton action="List" value="Back"/>
                <br />          
            </h:form>
        </ui:define>
    </ui:composition>

</html>
